package com.googlecode.jlogindexer.client.utils;

import org.apache.log4j.Logger;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringUtils {

	private static Logger logger = Logger.getLogger(SpringUtils.class);

	private static ApplicationContext context;

	static {
		try {
			System.out.println("Context INITIALIZED::::::::::::");
			ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
			//ApplicationContext applicationContext = new ClassPathXmlApplicationContext("XMLConfigapplicationContext.xml");
			
			context = applicationContext;
			System.out.println("CONTEXT:::: "+context);

		} catch (Exception e) {
			logger.error(e.getMessage(), e);
			e.printStackTrace();
		}
	}

	public static ApplicationContext getContext() {
		return context;
	}

}

